// pages/setting/setting.js
import { removeStorage } from "@/miniprogram/utils/storage"
import { userBehavior } from '@/miniprogram/utils/behaviors/userBehavior'

Component({
   behaviors: [userBehavior],
   data: {

   },
   methods: {
      onLoad(options) {
      },
      login() {
         wx.navigateTo({
            url: '/pages/login/login',
         })
      },
      loginOut() {
        let that = this
         wx.showModal({
            title: "确定退出登陆吗？",
            success(res) {
               
               if (res.confirm) {
                  removeStorage('uusd')
                  removeStorage('temp')
                  removeStorage('sessionToken')
                  removeStorage('cookies')
                  removeStorage('token')
                  that.routerActive()
               }
            }
         })
      },
      onShow() {

      },

      routerActive() {
         this.updateUserInfo()
         wx.reLaunch({
            url: '/pages/profile/profile',
         })
         wx.showToast({
            title: '退出成功！',
         })
      },

      privacySettings(e) {
         let { storeUser, notesMessage } = this.data
         wx.navigateTo({
            url: 'miniprogram/pre_loadModules/privacySettings/pages/privactSettings/privacySettings',
         })
      },
   }
})
